const id = GetQueryString('id') || -1;
let getStorageList = localStorage.getItem('list') || '[]';
let list = JSON.parse(getStorageList);
const item = list[id];
if(item) {
  const title = document.querySelector("#title");
  const codeNum = document.querySelector(".codeNum span");
  const info = document.querySelector(".info");
  title.innerText = item.title;
  codeNum.innerText = item.codeNum;
  info.innerText = item.intro;
} else {
  modal({
    title: '提示',
    content: '如果想查看课程信息，请在列表页点击要查看的信息进入该页面；',
    width: '500px',
    height: 'auto',
    cancelBtn: false,
    confirmBtn: true,
    cancelText: '取消',
    confirmText: '确认',
    cancelCallback: function() {},
    confirmCallback: function() {
      window.location = 'courselist.html'
    }
  });
}